package com.qf.service.impl;

import com.qf.entity.CarLocation;
import com.qf.entity.CarMessage;
import com.qf.mapper.CarMessageMapper;
import com.qf.service.CarMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Service
public class CarMessageServiceImpl implements CarMessageService {
    @Resource
    private CarMessageMapper carMessageMapper;


    @Override
    public int addCarMessage(CarMessage carMessage) {
        return carMessageMapper.insert(carMessage);
    }

    public CarLocation randomCar(List<CarLocation> list){
        ArrayList<CarLocation> carLocations = new ArrayList<>();

        for (CarLocation carLocation : list) {

            if (carLocation.getStatued()==1){
                continue;
            }
                carLocations.add(carLocation);


        }






        return null;
    }


    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();
        list.add(null);
        System.out.println(list.size());
    }
}
